import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class Aaa {
    public static void main(String[] args) throws Exception {
        File f1 = new File("D:\\test1.txt");
        FileInputStream in = new FileInputStream(f1);
        File f2 = new File("D:\\test2.txt");
        FileOutputStream out = new FileOutputStream(f2);
        byte[] a = new byte[100000];
        int n;
        while ((n=in.read(a))!=-1){
            out.write(a,0,n);

        }
        out.close();
        in.close();
    }
}
